/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ie.deloitte.cvapp.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author damorales
 */
@Entity
@Table(name = "experience", catalog = "javabootcamp", schema = "")
@NamedQueries({
    @NamedQuery(name = "Experience.findAll", query = "SELECT e FROM Experience e"),
    @NamedQuery(name = "Experience.findByIdEmployee", query = "SELECT e FROM Experience e WHERE e.employee_idEmployee = :employee_idEmployee"),
    @NamedQuery(name = "Experience.findByCompanyname", query = "SELECT e FROM Experience e WHERE e.companyname = :companyname")})
    /*@NamedQuery(name = "Experience.findByperiodStart", query = "SELECT e FROM Experience e WHERE e.periodStart = :periodStart"),
    @NamedQuery(name = "Experience.findByperiodFinish", query = "SELECT e FROM Experience e WHERE e.periodFinish = :periodFinish"),
    @NamedQuery(name = "Experience.findByRole", query = "SELECT e FROM Experience e WHERE e.Role = :Role"),
    @NamedQuery(name = "Experience.findBydescription", query = "SELECT e FROM Experience e WHERE e.description = :description"),
    @NamedQuery(name = "Experience.findByresponsibilities", query = "SELECT e FROM Experience e WHERE e.cresponsibilities = :responsibilities"),
    @NamedQuery(name = "Experience.findByprojectname", query = "SELECT e FROM Experience e WHERE e.projectname = :projectname"),
    @NamedQuery(name = "Experience.findByPrimarytelephone", query = "SELECT e FROM Experience e WHERE e.primarytelephone = :primarytelephone"),
    @NamedQuery(name = "Experience.findBySecondarytelepohne", query = "SELECT e FROM Experience e WHERE e.secondarytelepohne = :secondarytelepohne")})*/
public class Experience implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
//    @ManyToOne
//    @JoinColumn(name = "idEmployee")
//    private Experience experience;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idExperience", nullable = false)
    private Integer idExperience;
    //@Size(max = 45)
    @Column(name = "employee_idEmployee", nullable = false)
    private Integer employee_idEmployee;
    @Size(max = 45)
    @Column(name = "companyname", length = 45)
    private String companyname;
    @Size(max = 45)
    @Column(name = "periodStart", length = 45)
//    @Temporal(TemporalType.DATE)
    private String periodStart;
    @Size(max = 45)
    @Column(name = "periodFinish", length = 45)
//    @Temporal(TemporalType.DATE)
    private String periodFinish;
    @Size(max = 45)
    @Column(name = "Role", length = 45)
    private String role;
    @Size(max = 1000)
    @Column(name = "Description", length = 1000)
    private String description;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 1000)
    @Column(name = "Responsibilities", length = 1000)
    private String Responsibilities;
    @Size(max = 255)
    @Column(name = "projectname", length = 255)
    private String projectname;
    
   

    public Experience() {
    }
    
    public Experience(Integer idExperience) {
    	this.idExperience = idExperience;
    }
    
    public Integer getidExperience() {
    	return idExperience;
    }
    
    public void setidExperience(Integer idExperience) {
    	this.idExperience = idExperience;
    }

//    public Experience(Integer idEmployee) {
//        this.Employee_idEmployee = idEmployee;
//    }

    public Integer getEmployee_idEmployee() {
        return employee_idEmployee;
    }

    public void setEmployee_idEmployee(Integer idEmployee) {
        this.employee_idEmployee = idEmployee;
    }

    public String getCompanyname() {
        return companyname;
    }

    public void setCompanyname(String Companyname) {
        this.companyname = Companyname;
    }

    public String getperiodStart() {
        return periodStart;
    }

    public void setperiodStart(String periodStart) {
        this.periodStart = periodStart;
    }

    public String getperiodFinish() {
        return periodFinish;
    }

    public void setperiodFinish(String periodFinish) {
        this.periodFinish = periodFinish;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getResponsibilities() {
        return Responsibilities;
    }

    public void setResponsibilities(String Responsibilities) {
        this.Responsibilities = Responsibilities;
    }

    public String getprojectname() {
        return projectname;
    }

    public void setprojectname(String projectname) {
        this.projectname = projectname;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (employee_idEmployee != null ? employee_idEmployee.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Experience)) {
            return false;
        }
        Experience other = (Experience) object;
        if ((this.employee_idEmployee == null && other.employee_idEmployee != null) || (this.employee_idEmployee != null && !this.employee_idEmployee.equals(other.employee_idEmployee))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ie.deloitte.cvapp.domain.Experience[ idEmployee=" + employee_idEmployee + " ]";
    }

	
    
}
